package com.dudu.utils;

import java.util.HashMap;
import java.util.Map;
import java.util.PropertyResourceBundle;
import java.util.Random;
import java.util.ResourceBundle;

public class ProperyResource {
	
	private static ResourceBundle resourceBundle = PropertyResourceBundle.getBundle("imsconfig");
	
	private static Map<String, String> keyMap = new HashMap<String, String>();
	static {
		keyMap.put("865927294065", "61434838");
		keyMap.put("865925023552", "11217924");
		keyMap.put("8659523799749", "65956525");
		keyMap.put("8659188709468", "01223795");
	}
	
	public static String getSpId(){
		return resourceBundle.getString("spid");
	}
	
	public static String getServiceUrl(){ 
		return resourceBundle.getString("service_url");
	}
	
	public static String getPassword(){ 
		return resourceBundle.getString("pwd");
	}
	
	public static String getChargeNbr(){
		return resourceBundle.getString("chargenbr");
	}
	
	public static String getChargeKey(){
		return resourceBundle.getString("key");
	}
	
	public static String getAppId(){
		return resourceBundle.getString("appid");
	}
	
	
	
	public static float getUnitPrice(){
		return Float.valueOf(resourceBundle.getString("unit_price"));
	}
	
	public static float getGiftAmount(){
		return Float.valueOf(resourceBundle.getString("gift_amount"));
	}
	
	public static float getTestIsvAmount(){
		return Float.valueOf(resourceBundle.getString("test_isv_amount"));
	}
	
	public static String getphoneNums(){
		return resourceBundle.getString("phoneNums");
	}
	
	public static String getphoneNum(){
		return resourceBundle.getString("phoneNum");
	}
	
	public static String getTestPhoneNums(){
		return resourceBundle.getString("test_phones");
	}
	
	public static String getSOAP_ABILITY(){
		return resourceBundle.getString("SOAP_ABILITY");
	}
	
	public static String getSOAP_username(){
		return resourceBundle.getString("SOAP_username");
	}
	
	public static String getSOAP_password(){
		return resourceBundle.getString("SOAP_password");
	}
	
	//根据计费号获取对应的key
	public static String getKeyByNbr(String nbr){
		return keyMap.get(nbr.trim());
	}
	
	public static String getEcp_Status_Url(){
		return resourceBundle.getString("ecp_status_url");
	}
	
	public static String getEcpChargePhone(){
		return resourceBundle.getString("ecp_charge_phone");
	}
	
	public static String getSoapStatusCallbackAdd(){
		return resourceBundle.getString("ims_soap_status_callback");
	}
	
	public static String getDefaultSoapConfTime(){
		return resourceBundle.getString("ims_soap_confer_time_length");
	}
	
	public static String getServiceUploadVoiceUrl(){
		return resourceBundle.getString("SERVICE_UPLOADVOICE");
	}
	
	
	public static void main(String[] args){
		 Random rand = new Random();
		 for(int i=0;i<100;i++){
			 int num = rand.nextInt(4);
		 }
		 
	}
}
